Add BABL_IS_BEING_COMPILED #define support
authorMartin Nordholts <martinn@src.gnome.org>
Mon, 27 Dec 2010 20:34:00 +0000 (21:34 +0100)
committerMartin Nordholts <martinn@src.gnome.org>
Mon, 27 Dec 2010 20:34:00 +0000 (21:34 +0100)
Sometimes it is ok that babl includes are included directly and not
through babl.h, like when we generate GObject introspection files.

The important thing is just that users of the babl API don't begin to
include headers we don't guarantee to always exist, and
BABL_IS_BEING_COMPILED doesn't obstruct this goal.

babl/Makefile.am
babl/babl-macros.h
babl/babl-types.h
babl/babl-version.h.in

index 979afb5b79c104afccc1de93eb08a85aa097bf49..182326513ba335c7cb9239364f7ee0530c4c4cf7 100644 (file)
@@ -96,6 +96,7 @@ Babl-$(BABL_API_VERSION).gir: $(G_IR_SCANNER) $(library_include_HEADERS) $(c_sou
             --libtool="$(LIBTOOL)" \
             --output $@ \
             --pkg babl \
+            -DBABL_IS_BEING_COMPILED \
            -I$(top_srcdir) \
            -I$(top_builddir) \
            $(library_include_HEADERS) \
index 8de6864930be91268c204c5a5bb8a569fd7c0975..f022d9f9f0bebc6657a66e1010049d98aae7415f 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _BABL_MACROS_H
 #define _BABL_MACROS_H
 
-#ifndef BABL_INSIDE_BABL_H
+#if !defined(BABL_INSIDE_BABL_H) && !defined(BABL_IS_BEING_COMPILED)
 #error "babl-version.h must not be included directly, include babl.h instead."
 #endif
 
index d1deae745f8a99ff9268255949e23edc1d65008d..162e6c9a25185dedd55bd38efc6ae9897a3edaa3 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _BABL_TYPES_H
 #define _BABL_TYPES_H
 
-#ifndef BABL_INSIDE_BABL_H
+#if !defined(BABL_INSIDE_BABL_H) && !defined(BABL_IS_BEING_COMPILED)
 #error "babl-version.h must not be included directly, include babl.h instead."
 #endif
 
index 97890994a21101b71a7f6c4622b9e57d77223a04..ab008244cb969dd159b7e7849025d1d04799d506 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _BABL_VERSION_H
 #define _BABL_VERSION_H
 
-#ifndef BABL_INSIDE_BABL_H
+#if !defined(BABL_INSIDE_BABL_H) && !defined(BABL_IS_BEING_COMPILED)
 #error "babl-version.h must not be included directly, include babl.h instead."
 #endif